package com.karl.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.karl.dao.ProductDao;
import com.karl.entity.Product;
import com.karl.service.ProductManager;
import com.karl.util.Page;

@Component("productManager")
public class ProductManagerImpl implements ProductManager{

	private ProductDao productDao;
	public ProductDao getProductDao() {
		return productDao;
	}
	@Resource
	public void setProductDao(ProductDao productDao) {
		this.productDao = productDao;
	}
	@Override
	public void add(Product p) {
		// TODO Auto-generated method stub
		productDao.save(p);
	}
	@Override
	public List<Product> list(String key) {
		// TODO Auto-generated method stub
		return productDao.list(key);
	}
	@Override
	public int count() {
		// TODO Auto-generated method stub
		return productDao.count();
	}
	@Override
	public Page firstPage() {
		// TODO Auto-generated method stub
		return productDao.firstPage();
	}
	@Override
	public Page endPage() {
		// TODO Auto-generated method stub
		return productDao.endPage();
	}
	@Override
	public Page prePage() {
		// TODO Auto-generated method stub
		return productDao.prePage();
	}
	@Override
	public Page nextPage() {
		// TODO Auto-generated method stub
		return productDao.nextPage();
	}
	@Override
	public Page selectPage(int i) {
		// TODO Auto-generated method stub
		return productDao.selectPage(i);
	}
	
	

}
